﻿$(document).ready(function () {
    $("#btnAddSection").click(function () {
        //Invoke AJAX method to generate new password
        $.post(pathPrefix + "Albums/GeneratePassword", null, function (result) {
            var data = {
                "EditorPassword": result,
                "PagesCount": 2
            };

            $("#sectionRowTemplate").tmpl(data).appendTo("ul#Sections");
        }, "json");
    });

    $(".removeSection").live("click", function () {
        //remove the selected row
        $(this).parents("li").remove();

        return false;
    });
});